package com.sy.pet.controller.admin;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.sy.pet.commom.ResultBean;
import com.sy.pet.commom.enmu.AuditStatus;
import com.sy.pet.dto.PetAdoptionQueryDTO;
import com.sy.pet.entity.UserAuthentication;
import com.sy.pet.service.PetAdoptionService;
import com.sy.pet.service.UserAuthenticationService;
import com.sy.pet.vo.PetAdoptionRecordVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: liangSY
 * @Date: 2024/9/17
 * @ClassName: UserAuthenticationAdminController
 * @Description: UserAuthenticationAdminController描述
 */
@RequestMapping("/admin/authentication")
@RestController
public class UserAuthenticationAdminController {

    @Autowired
    UserAuthenticationService userAuthenticationService;

    @PostMapping("/page")
    private ResultBean<IPage<UserAuthentication>> getPetList(@RequestBody PetAdoptionQueryDTO dto){
        IPage<UserAuthentication> all = userAuthenticationService.getPageData(dto);
        return ResultBean.success(all);
    }

    @PutMapping("/{id}/{status}")
    private ResultBean<IPage<PetAdoptionRecordVO>> getPetList(@PathVariable("id") String id,@PathVariable("status") AuditStatus status){
        userAuthenticationService.audit(id,status);
        return ResultBean.success();
    }
}
